Q: What is the dump word and how do I use it?A: dump is meant to be used to dump a section of RAM, but not PCI space, to standard output. Its stack comment is ( addr len -- ). The unit for len is bytes. For instance, base is the variable used to hold the radix for the user interface. Enter this sequence of words at the terminal to display the current base. Remember, your base may be different than mine. Here is what my base holds. 0> cr base 4 dump
ff812348: 00 00 00 10 :....: ok
0>
The arguments for dump are the address of base and the length of base. The least significant byte is hex 10 or 16 in decimal, which is what we would expect. Let's look at another way to dump base. Set base to hex then place base onto the stack and read base using @. @ is the Forth word that reads a cell. A cell is the unit of information in Open Firmware. For the Motorola microprocessor this cell is defined as 32 bits. Next, display the stack in decimal using .d. The result is 16, which is what we would expect. 0> hex base @ .d 16 ok
Try it again. This time, enter 10 for the base and again display the stack in decimal. 0> decimal base @ .d 10
We looked at two words for displaying memory dump and @. The first word dump will display an area of memory in both hex and ASCII. The second word will read a cell. If you want to display a variable use the word @ instead of dump. Document Revision HistoryDate | Notes |
---|
1999-10-11 | New Document |
Posted: 1999-10-11
|